From: Lars Ingebrigtsen Date: Mon, 19 Jul 2021 15:31:17 +0000 (+0200) Subject: Fix infloop in woman-file-name X-Git-Tag: archive/raspbian/1%29.2+1-2+rpi1^2~5^2~18^2~2056 X-Git-Url: https://dgit.raspbian.org/%22http:/www.example.com/cgi/%22https:/www.github.com/%22bookmarks:///%22http:/www.example.com/cgi/%22https:/www.github.com/%22bookmarks:/?a=commitdiff_plain;h=8f51194aa5f2e3300d60bca9c7b6630ee11d9a70;p=emacs.git Fix infloop in woman-file-name * lisp/woman.el (woman-file-name): Fix infloop for non-existent manual page (bug#414). --- diff --git a/lisp/woman.el b/lisp/woman.el index d9aa573d27b..0bc992d8f7f 100644 --- a/lisp/woman.el +++ b/lisp/woman.el @@ -1274,9 +1274,11 @@ cache to be re-read." ;; Complete topic more carefully, i.e. use the completion ;; rather than the string entered by the user: ((setq files (all-completions topic woman-topic-all-completions)) - (while (/= (length topic) (length (car files))) + (while (and files + (/= (length topic) (length (car files)))) (setq files (cdr files))) - (setq files (woman-file-name-all-completions (car files))))) + (when files + (setq files (woman-file-name-all-completions (car files)))))) (cond ((null files) nil) ; no file found for topic. ((null (cdr files)) (car (car files))) ; only 1 file for topic.